{include file=$header_start}
{strip}
<script type="text/javascript" src="{$siteroot}/includes/js/admin/checkall.js" /></script>
{/strip}
{include file=$header_end}
{literal}
<script type="text/javascript">
$(function(){
$(".someClass").tipTip();
});

$(function(){
$(".someClass").tipTip({maxWidth: "auto", edgeOffset: 10});
});
</script>
{/literal}
<div class="contain">
      {include file=$left_menu}
      <div class="right_contain">
         <div class="heading_box">{if $smarty.get.pid} Job Type For "{$parentArray.trade_category|ucfirst}"{else}Manage Trade Categories {/if}<a href="javascript:;" class="someClass" title="{$moduelArray.module_help_text}" style="float:right;"><img src="{$siteroot}/templates/admin/img/topic_icon6.png" /></a> </div>
         <div class="whitebox">
         
         <!--Message Div Start-->
         {if $msg}
         <div class="masg_div">
         	{$msg}
         </div>
         {/if}
         <!--Message Div End-->
         
         <div>
          <!--Form Contain start-->
           
           <div class="table_viewbox">
            <!--<h2>Table Design</h2>-->
            <form name="searchFrm" id="searchFrm" method="post"  {if $smarty.get.pid} action="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}" {else} action="{$siteroot}/admin/home.php?q=tradecategories" {/if}>
            	<table width="100%" border="0" cellpadding="3" cellspacing="5">
                	<tr>
                    	<td align="left"><input type="button" name="add" id="add" {if $smarty.get.pid} value="Add Job Type" {else}value="Add Trade Category"{/if} class="admin_btn" {if $smarty.get.pid} onclick="javascript: window.location='{$siteroot}/admin/home.php?q=addtradecategory&pid={$smarty.get.pid}';" {else} onclick="javascript: window.location='{$siteroot}/admin/home.php?q=addtradecategory';" {/if} /></td>
                        <td align="right"><input type="text" name="search" id="search" class="input41" value="{if $search neq ''}{$search}{else}Search{/if}" onfocus="this.value=''" onblur="if(this.value=='')this.value='Search'" />&nbsp;<input type="submit" name="add" id="add" value="Search" class="admin_btn" />&nbsp;<input type="button" name="add" id="add" value="Clear" class="admin_btn" {if $smarty.get.pid} onclick="javascript: window.location='{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}';" {else} onclick="javascript: window.location='{$siteroot}/admin/home.php?q=tradecategories';"{/if} />{if $smarty.get.pid}&nbsp;<input type="button" name="add" id="add" value="Back" class="admin_btn" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=tradecategories&page={$page}';" />{/if}</td>
                    </tr>
                </table>
            </form>
            
            <form name="frm" id="frm" action="" method="post" >
            <input type="hidden" name="hidden_pageno" id="hidden_pageno" value="{$page}" />
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th width="3%" align="center">#</th>
                <th width="3%"><input type="checkbox" name="check" id="check"  /></th>
                <th width="50%">
                {if $smarty.get.pid} 
                	<div class="lF"><a {if $smarty.get.col1|base64_decode eq '0'} href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&col1={1|base64_encode}&page={$page}" {else}href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&col1={0|base64_encode}&page={$page}" {/if}>Job Type</a></div>
		
                	<div class="lF" style="margin-left:10px; height:15px;">
                    	<div style="width:10px; height:6px;"><a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&col1={0|base64_encode}&page={$page}" ><img {if $smarty.get.col1|base64_decode eq '1' } src="{$siteroot}/templates/admin/img/admin_toparrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_toparrow_black.png" {/if} title="ACS" width="10" height="6" align="top" /></a> <br /></div>
                        <div style="width:10px; height:6px;margin-top:3px;*margin-top:4px;"><a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&col1={1|base64_encode}&page={$page}"><img {if $smarty.get.col1|base64_decode eq '0' || $smarty.get.col1|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_downarrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_downarrow_black.png" {/if} title="DESC"  width="10" height="6" align="bottom"/></a></div>
                    </div>
                    <div class="clear"></div>                    
                {else}
                	<div class="lF"><a {if $smarty.get.col1|base64_decode eq '0'} href="{$siteroot}/admin/home.php?q=tradecategories&col1={1|base64_encode}&page={$page}" {else}href="{$siteroot}/admin/home.php?q=tradecategories&col1={0|base64_encode}&page={$page}" {/if}>Trade Category</a></div>
		
                	<div class="lF" style="margin-left:10px; height:15px;">
                    	<div style="width:10px; height:6px;"> <a href="{$siteroot}/admin/home.php?q=tradecategories&col1={0|base64_encode}&page={$page}" ><img {if $smarty.get.col1|base64_decode eq '1' || $smarty.get.col2 neq ''} src="{$siteroot}/templates/admin/img/admin_toparrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_toparrow_black.png" {/if} title="ACS" width="10" height="6" align="top"/></a> <br /></div> 
                        <div style="width:10px; height:6px;margin-top:3px;*margin-top:4px;"><a href="{$siteroot}/admin/home.php?q=tradecategories&col1={1|base64_encode}&page={$page}"><img {if $smarty.get.col1|base64_decode eq '0' || $smarty.get.col1|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_downarrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_downarrow_black.png" {/if} title="DESC"   width="10" height="6" align="bottom"/></a></div>
                    </div>
                    <div class="clear"></div>                   
                {/if}</th>
                {if $smarty.get.pid eq ''}<th width="10%"> 
                Job Type
	               <!-- <div class="lF"><a {if $smarty.get.col2|base64_decode eq '0'} href="{$siteroot}/admin/home.php?q=tradecategories&col2={1|base64_encode}&page={$page}" {else}href="{$siteroot}/admin/home.php?q=tradecategories&col2={0|base64_encode}&page={$page}" {/if}>Job Type</a></div>
                	<div class="lF" style="margin-left:10px;  height:15px;">
                    	<div style="width:10px; height:6px;"><a href="{$siteroot}/admin/home.php?q=tradecategories&col2={0|base64_encode}&page={$page}" ><img {if $smarty.get.col2|base64_decode eq '1' || $smarty.get.col2|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_toparrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_toparrow_black.png" {/if} title="ASC"  width="10" height="6" align="top"/></a> <br /></div>
                        <div style="width:10px; height:6px; margin-top:3px; *margin-top:4px;"><a href="{$siteroot}/admin/home.php?q=tradecategories&col2={1|base64_encode}&page={$page}"><img {if $smarty.get.col2|base64_decode eq '0' || $smarty.get.col2|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_downarrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_downarrow_black.png" {/if} title="DESC"  width="10" height="6" align="bottom" /></a></div>
                    </div>-->
                    <div class="clear"></div>     
                </th>{/if}
                {if $smarty.get.pid}
                    <th width="10%">Price</th>
                    <th width="10%">Expired Time</th>
                {/if}
                <th width="15%">Action</th>
              </tr>
              {section name=i loop=$tradeArray}
              <tr class="inactiverow" id="tr_{$tradeArray[i].id}">
                <td align="center">{$newid}</td>
                <td><input type="checkbox" name="checkall[]" id="checkall_{$smarty.section.i.iteration}" value="{$tradeArray[i].id}" {if $tradeArray[i].used eq 'jobtype' || $tradeArray[i].used eq 'tradecat'}  disabled="disabled" {/if} /></td>
                {if $smarty.get.pid}
                <td>{$tradeArray[i].trade_category}</td>  
                <td>${if $tradeArray[i].price eq ''}0{else}{$tradeArray[i].price}{/if}</td>  
                <td>{if $tradeArray[i].expired_time eq ''}0 month{else}{$tradeArray[i].expired_time} months{/if}</td>                
                <td>
                    <span>
                    	{if $tradeArray[i].status eq '1'}
                    			<a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&id={$tradeArray[i].id|base64_encode}&action=status&status={$tradeArray[i].status}&page={$page}" onclick="javascript:return confirm('Are you sure do you want to change status?');" title="Currently Active"><img src="{$siteroot}/templates/admin/img/icon_correct.png" /></a>
                        {else}
                        		<a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&id={$tradeArray[i].id|base64_encode}&action=status&status={$tradeArray[i].status}&page={$page}" onclick="javascript:return confirm('Are you sure do you want to change status?');" title="Currently Inactive"><img src="{$siteroot}/templates/admin/img/close.png" /></a>
                        {/if}
                    </span>
                    
                    <span><a href="{$siteroot}/admin/home.php?q=edittradecategory&pid={$smarty.get.pid}&id={$tradeArray[i].id|base64_encode}&action=edit&page={$page}" title="Edit Job Type"><img src="{$siteroot}/templates/admin/img/icon_edit.png"/></a></span>
                    {if $tradeArray[i].used eq 'jobtype' || $tradeArray[i].used eq 'tradecat'}	                    
                        <span><a href="javascript:;" title="This job type can't delete because used in lead price module"><img src="{$siteroot}/templates/admin/img/icon-deletewarning.png" /></a></span>
                    {else}    
                    	<span><a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$smarty.get.pid}&id={$tradeArray[i].id|base64_encode}&action=delete&page={$page}" title="Delete Job Type"><img src="{$siteroot}/templates/admin/img/icon-delete.png" onclick="javascript:return confirm('Are you sure do you want to delete this record?');" /></a></span>
                    {/if}    
                </td>
                {else}
                <td><a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$tradeArray[i].id|base64_encode}&page={$page}">{$tradeArray[i].trade_category}</a></td>
               	<td align="left" style="padding-left:30px;"><span><a href="{$siteroot}/admin/home.php?q=tradecategories&pid={$tradeArray[i].id|base64_encode}&page={$page}" title="Job Type">[{$tradeArray[i].cntjobtype}]</a></span></td>
                
                <td>
                    <span>
                    	{if $tradeArray[i].status eq '1'}
                    			<a href="{$siteroot}/admin/home.php?q=tradecategories&id={$tradeArray[i].id|base64_encode}&action=status&status={$tradeArray[i].status}&page={$page}" onclick="javascript:return confirm('Are you sure do you want to change status?');" title="Currently Active"><img src="{$siteroot}/templates/admin/img/icon_correct.png" /></a>
                        {else}
                        		<a href="{$siteroot}/admin/home.php?q=tradecategories&id={$tradeArray[i].id|base64_encode}&action=status&status={$tradeArray[i].status}&page={$page}" onclick="javascript:return confirm('Are you sure do you want to change status?');" title="Currently Inactive"><img src="{$siteroot}/templates/admin/img/close.png" /></a>
                        {/if}
                    </span>
                    
                    <span><a href="{$siteroot}/admin/home.php?q=edittradecategory&id={$tradeArray[i].id|base64_encode}&action=edit&page={$page}" title="Edit Trade Category"><img src="{$siteroot}/templates/admin/img/icon_edit.png"/></a></span>
                    {if $tradeArray[i].used eq 'jobtype' || $tradeArray[i].used eq 'tradecat'}	                    
                        <span><a href="javascript:;" title="This trade category can't delete because used in lead price module"><img src="{$siteroot}/templates/admin/img/icon-deletewarning.png" /></a></span>
                    {else}    
	                    <span><a href="{$siteroot}/admin/home.php?q=tradecategories&id={$tradeArray[i].id|base64_encode}&action=delete&page={$page}" title="Delete Trade Category"><img src="{$siteroot}/templates/admin/img/icon-delete.png" onclick="javascript:return confirm('Are you sure do you want to delete this record?');" /></a></span>
                    {/if}   
                    
                    
                </td>
                {/if}
                
              </tr>
              <!-- {$newid++} -->
              {sectionelse}
              <tr>
              		<td colspan="7" align="center">
                    {if $search}
              				<span class="error" style="text-align:center">No Record Found</span>
                     {else}       
                            <span class="error" style="text-align:center">{if $smarty.get.pid} No Job Type Added{else}No Trade Category Added{/if}</span>
                      {/if}      
                    </td>
               </tr>     
              {/section}
              
               <tr>
                <td colspan="7">
                {if $tradeArray}
                <div class="select_box">
                <select name="action" id="action" class="input width">
                  <option value="">Select</option>
                  <option value="active">Active</option>
                  <option value="inactive">Inactive</option>
                  <option value="delete">Delete</option>
                  </select>&nbsp;<input type="submit" class="admin_btn" value="Go" name="go" id="go" /><div id="errormsg" class="error"></div> 
                  
                  </div>
                  <div class="pagination">
                  {if $pagination}{$pagination}{/if}
                  </div>
                  {/if}
                   </td>
                  
              </tr>
            </table>
</form>
         </div>
            <!--Form Contain end--> 
         </div>
         </div>
        </div>
      <!--right_contain end-->
      <div class="clear"></div>
    </div>
{include file=$footer}